READ <file ID>, <name>
READ File1, Var1
Reads the next numeric value from a general read file and assigns that value to a name. General read files are defined in the External Files Editor. When reading from a file,
Please Note:
READ can read ASCII files. Most spreadsheet programs can convert spreadsheets to ASCII files (.TXT) and comma-delimited files (.CSV).
If a read statement is not assigning the right values to the proper name, there may be numeric information in the read-file’s header information (notes and comments). Additionally, if the values are being read into an array, the array indices may not be incremented properly between reads.
If a read file should be read more than once in a model, it may need to be reset. One way to tell when a file needs to be reset is with an end of file marker such as 9999 and the following two lines of logic.
Read File1,Value
IF Value= 9999 THEN RESET File1
Any logic.
<file ID>
The file identifier as defined in the External Files Editor.
<name>
The variable, array element, or attribute to be assigned the value.
The example below shows an outside file being read in the Arrival logic for entity type Box. In this case three values representing the length, width and depth of each Box are listed on each line of a file called “Size.Dat.” The File ID for this file is simply Size. Length, Width, and Depth are all entity attributes.
See Also
General Read File. Also see RESET and CLOSE.
![]() |
© 2012 ProModel Corporation • 556 East Technology Avenue • Orem, UT 84097 • Support: 888-776-6633 • www.promodel.com |